home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Testing & Debugging / Virtual User Libraries & Tools / VU-Related Tools / VUMark 1.0b1 < prev   
Encoding:
Text File  |  1992-05-05  |  2.2 KB  |  85 lines  |  [TEXT/MPS ]

  1. ## VUMark - a script by NJV designed to mark tasks in VU scripts.
  2. ##
  3. ## Usage:    To use VUMark, just put this script into the MPW Scripts folder (or somewhere
  4. ##            where MPW can find it) and type the following line from the worksheet:
  5. ##
  6. ##                VUMark theScriptName
  7. ##
  8. ##            where theScriptName is the name (and path, if not in current directory) of
  9. ##            the VU script to be marked.  If you do not wish the file to be closed after
  10. ##            being marked, use the following syntax:
  11. ##
  12. ##                VUMark -nc theScriptName
  13. ##
  14. ## Examples -    VUMark -nc myScript.vu
  15. ##                VUMark myScript.vu
  16. ##
  17. ## 10/5/90 - created version 1.0a1
  18. ## 10/6/90 - Now ignores case and will find task names with _ in them.  Any other characters
  19. ##             that need to be included, please let me know.  - NJV
  20. ##
  21.  
  22. set Version "1.0b1"
  23. set exit 0
  24.  
  25. if ({#} == 0)
  26.     echo
  27.     echo "## {0} Version {Version} - by NJV"
  28.     echo "##"
  29.     echo "## Desc. -    {0} will search the requested file for the literal string ∂"Task∂" at"
  30.     echo "##            the beginning of a line and will mark that location with the task name "
  31.     echo "##            (the word following the task string).  Once the end of the file is reached,"
  32.     echo "##            the file will be saved and, if the -nc parameter is not present, closed."
  33.     echo "## Usage:"
  34.     echo "## {0} [-nc] ∂"vuScriptName∂""
  35.     echo "##"
  36.     echo "##        -nc                -    Optional parameter - if present, VUMark will not close (nc)"
  37.     echo "##                            the script after marking it."
  38.     echo "##        vuScriptName    -    The name of the VU script to be marked"
  39.     echo "##"
  40.     echo "## Example:"
  41.     echo "##        {0} ∂"myScript.vu∂""
  42.     echo "##        {0} -nc ∂"myScript.vu∂""
  43.     echo "##"
  44.     exit 1
  45. end
  46.  
  47.  
  48. Set CloseFile 1
  49. if "{1}" =~ /-nc/
  50.     set CloseFile 0
  51.     Open "{2}"
  52. else
  53.     Open "{1}"
  54. end
  55.  
  56. Set oldWrap {SearchWrap}
  57. Set SearchWrap 0
  58. Set oldType {SearchType}
  59. Set SearchType 0
  60. Set oldBack {SearchBackward}
  61. Set SearchBackward 0
  62. Set oldCase {CaseSensitive}
  63. Set CaseSensitive 0
  64.  
  65. Find • "{Active}"
  66.  
  67. loop
  68.     Find /•task[∂r∂t]*/ "{Active}"
  69.     Break if {status} == 2
  70.     Find /[A-Za-z_0-9]+/ "{Active}"
  71.     Set tempName "`Catenate "{Active}".§`";
  72.     Mark -y § "{tempName}" "{Active}"
  73. End
  74.  
  75. Save "{Active}"
  76.  
  77. if {CloseFile}
  78.     Close "{Active}"
  79. end
  80.  
  81. Set SearchWrap {oldWrap}
  82. Set SearchType {oldType}
  83. Set SearchBackward {oldBack}
  84. Set CaseSensitive {oldCase}
  85.